#include "LRF.h"

LRF::LRF()
{
	for(int i = 0; i < LRF_SIZE; i++)
		lrf[i] = LRF_DEFUALT_VALUE;
}

int LRF::write(int loc, int value)
{
	int rv = 0;
	if (loc >= 0 && loc < LRF_SIZE)
	{
		lrf[loc] = value;
		rv = 1;
	}
	return rv;
}

int LRF::read(int loc, int& value)
{
	int rv = 0;
	if (loc >= 0 && loc <= LRF_SIZE)
	{
		value = lrf[loc];
		rv = 1;
	}
	return rv;
}

int LRF::clear()
{
	for(int i = 0; i < LRF_SIZE; i++)
		lrf[i] = LRF_DEFUALT_VALUE;

	return 1;
}

